package com.nuanshui.heatedloan.credit.handler.execute;

import com.beust.jcommander.internal.Lists;
import com.nuanshui.heatedloan.credit.bean.CustomAuthHandlerMeta;

import java.util.Collections;
import java.util.List;

/**
 * Created by wangxw on 2017/6/26.
 */
public class CustomAuthExecuteRegister {

    //用来存放执行器的集合
    private List<CustomAuthHandlerMeta>  customAuthHandlerMetas=
            Lists.newArrayList();


    public List<CustomAuthHandlerMeta> getCustomAuthHandlerMetas() {
        return customAuthHandlerMetas;
    }

    public void setCustomAuthHandlerMetas(List<CustomAuthHandlerMeta> customAuthHandlerMetas) {
        this.customAuthHandlerMetas = customAuthHandlerMetas;
    }

    public synchronized  void regisgerCustomAuthHandler(CustomAuthHandlerMeta customAuthHandlerMeta){
        customAuthHandlerMetas.add(customAuthHandlerMeta);
        Collections.sort(customAuthHandlerMetas);
    }

}
